//
//  BaseTableViewController.swift
//  sina
//
//  Created by lixuelei on 6/10/15.
//  Copyright © 2015 itcast. All rights reserved.
//

import UIKit

class BaseTableViewController: UITableViewController,VisitorLogingViewDelegate {

    
    var visitorLogingView :VisitorLogingView?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        


    }
    //是苹果专门为手写代码准备的,一旦实现了此方法 所有的xib/sb都会失效
    //当控制器视图被初始化后,它会检测view是否为空,如果为空会自动调用loadview
    override func loadView() {
        visitorLogingView = NSBundle.mainBundle().loadNibNamed("VisitorLogingView", owner: nil, options: nil).last as? VisitorLogingView
        //设置代理
        visitorLogingView?.visitorLoginDelegate = self
        view = visitorLogingView
        
        //添加导航栏的barButtonItem
        self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action: "visitorZC")
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登陆", style: UIBarButtonItemStyle.Plain, target: self, action: "visitorDL")
//        UINavigationBar.appearance().tintColor = UIColor.orangeColor()
        
    }
    
    //实现协议方法
    func visitorDL(){
    
        print(__FUNCTION__)
    }
    func visitorZC() {
        print(__FUNCTION__)

    }
    
    
    
    
    
    
    
    
    
    
    
    

}
